HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spawning Items

09-10-2006, 03:35 AM#1
Pheonix-IV
Trigger:
Items
Collapse Events
Player - Player 1 (Red) types a chat message containing item as A substring
Collapse Conditions
(Substring((Entered chat string), 1, 4)) Equal to item
Collapse Actions
Set temppoint = (Position of Spawner)
Item - Create (Item-type((Substring((Entered chat string), 6, (Length of (Entered chat string)))))) at temppoint
Custom script: call RemoveLocation(udg_temppoint)

This doesn't work. Why?
09-10-2006, 04:19 AM#2
Alevice
Not sure why it shouldn't (no WE before me), but perhaps the parsing is incorrect. Try appending the following

Trigger:
Items
Collapse Events
Player - Player 1 (Red) types a chat message containing item as A substring
Collapse Conditions
(Substring((Entered chat string), 1, 4)) Equal to item
Collapse Actions
Set temppoint = (Position of Spawner)
Set tempstring = (Substring((Entered chat string), 6, (Length of (Entered chat string))))
Custom script: call BJDebugMsg(udg_tempstring)
Item - Create (Item-type(tempstring)) at temppoint
Custom script: call RemoveLocation(udg_temppoint)
09-10-2006, 08:59 AM#3
blu_da_noob
I can't find any function in the GUI which converts a string to an item type.
09-10-2006, 10:12 AM#4
Pheonix-IV
It is a WEU trigger, what's confusing is that it worked a few weeks ago, then all of a sudden it started throwing the error "expected a name"

If you can give me a line of custom script to substitute, thats fine too.

--EDIT--

Whoa! I get the feeling this has something to do with this not working anymore O_o.

Click image for larger version

Name:	WTF.jpg
Views:	30
Size:	742.2 KB
ID:	12317
Attached Images
File type: jpgWTF.jpg (742.2 KB)
09-11-2006, 06:14 AM#5
Pheonix-IV
*Bump*

Little help please?
09-11-2006, 06:43 AM#6
PitzerMike
It seems like something is overriding the WEU files.
Look in your war3 dir if there's an UI\ folder that might contain .txt files.

If that's the case remove (or temporarily disable it) and restart the WE again.
09-13-2006, 05:32 AM#7
Pheonix-IV
I've got a custom miscdata.txt, i tried removing the UI folder, still not working.

I noticed this too, what the hell is going on

Click image for larger version

Name:	WTF2.jpg
Views:	17
Size:	485.2 KB
ID:	12434
Attached Images
File type: jpgWTF2.jpg (485.2 KB)
09-13-2006, 08:17 AM#8
Fireeye
I got that problem some time ago too, i re-installed WEU and it worked.
Well, but i dislike WEU now, because you can do all things in JASS and the maps are smaller.
09-13-2006, 09:45 AM#9
Pheonix-IV
Well i'd love to use JASS, but i don't know what line of f-ing code i should use.

I'm happy to go either way, i really don't care, so long as the outcome is the same.
09-13-2006, 12:04 PM#10
PitzerMike
Ok, the WEU files definitely didn't get loaded there.
If reinstalling WEU doesn't help, one possible problem may be data execution prevention in Service Pack 2 on an Athlon processor. (if that's the problem you can disable DEP for WEU under Computer Properties/Advanced/Performance/DEP)

If everything else failes you can also extract the contents of WE Unlimited.exe to the UI folder that you already have. You can open the exe with your favourite mpq program and extract the content to your war3 dir (except MiscData.txt if you don't want to overwrite your existing file)

Alternatively you can get rid of the Advanced WEU triggers and do a custom script call, which is what i suggest:
1. Remove the functions that WEU has added to your custom text header.
2. Put the following functions in the header instead:
Collapse JASS:
function Asc takes string char returns integer
  local string charmap = " !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
  local string first = SubString(char, 0, 1)
  local string c = ""
  local integer i = 0
  if (first == "" or first == null) then
    return 0
  elseif (first == "\b") then // backspace
    return 8
  elseif (first == "\t") then // horizontal tab
    return 9
  elseif (first == "\n") then // new line
    return 10
  elseif (first == "\f") then // form feed
    return 12
  elseif (first == "\r") then // carriage return
    return 13
  endif
  loop
    set c = SubString(charmap, i, i + 1)
    exitwhen (c == "")
    if (c == first) then
      return i + 32
    endif
    set i = i + 1
  endloop
  return 0
endfunction

function IdString2IdInteger takes string value returns integer
  if (StringLength(value) == 4) then
    return Asc(SubString(value, 0, 1)) * 0x1000000 + Asc(SubString(value, 1, 2)) * 0x10000 + Asc(SubString(value, 2, 3)) * 0x100 + Asc(SubString(value, 3, 4))
  elseif (StringLength(value) == 1) then
    return Asc(value)
  endif
  return 0
endfunction

3. Replace the Create Item line with the following custom script call:

Collapse JASS:
set bj_lastCreatedItem = CreateItem(IdString2IdInteger(SubString(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString()))), GetLocationX(udg_temppoint), GetLocationY(udg_temppoint))

However if you have used WEU functions in other places too, then you'd have to replace those with appropriate custom script calls too.
09-14-2006, 09:24 AM#11
Pheonix-IV
Where the hell is computer properties?
09-14-2006, 10:51 AM#12
PitzerMike
1. Click Start, click Run, type sysdm.cpl, and then click OK to open Control Panel.
2. Click the Advanced tab, click Performance, and then click Settings.
3. In Performance Options, click the Data Execution Prevention tab.
4. Click Turn on DEP for all programs and services except for those I select, and then click Add.
5. In the Open dialog box, locate and then click the WE Unlimited.exe.
6. Click Open, click Apply, and then click OK. When you are prompted to restart your system, click OK.

However if you had DEP turned off for all programs before, this will not be the solution for your problem.