Cool Pog Tricks
- SoupDragon
- Offline
- Moderator
Please Log in or Create an account to join the conversation.
Originally posted by Flamineo
Do death scripts require a hisim? Maybe you can't cast icBullet to hisim? Probably not that simple: I had thought all hsims could be cast to hisims.
[edit]Oops.
Another behaviour of sets and lists, specifically when using them as globals or object properties:Not sure why. The working version ought to be atomic{} if more than one process might try to do it at once.Code:[i]don't work[/i] hobject thing = Sim.Create("ini:/thing"); Set.Add(Global.Set("things"), thing); [i]works[/i] hobject thing = Sim.Create("ini:/thing"); set things = Global.Set("things"); Set.Add(things, thing); Global.SetSet("things", things);
[/edit]
Many scripting languages seem to have numerous minor problems like this. I'm more worried about Gramps example. GrandpaTrout, did you try putting the whole statement into parentheses? Or using variables to hold the two constants?
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Topic Author
- Offline
- King of Space
-Gtrout
Please Log in or Create an account to join the conversation.
Originally posted by GrandpaTrout
Some #2 items. I have not been able to get deathscripts to work with PBC bolt objects. They do work with REM missiles, but sometimes the player gets trapped with the dead sim. Cargo pods become targetable subsims when you child attach them to a ship. Countermeasure flares do not become targetable. Some can be fixed immobile. Some cannot. I will dig up a list of Object types. We can try to fill in the behavior. (like a group crossword!)
-Gtrout
Were you actually trying to get a bolt to go through a deathscript??
why would one want that?
Here is the way I handle Deathscripts for example:
as you see I have different sim types going through the function and do all kinds of different stuff with em.
Edit: sorry the script got hard to read, I forget to close my code entry with /code
EOC/IWar2 Multiplayer Fansite
Please Log in or Create an account to join the conversation.
Only obvious workaround that springs to mind:
If anyone can see a fix for this, please shout. If 2 or more others confirm the bug, it can join the other gotchas for future reference.
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Topic Author
- Offline
- King of Space
I have never used locks. I just use global booleans inside atomic statements. They are fast and tested. You may have already seen this, but just in case:
// Grab lock
atomic {
if (false == Global.Bool("myLock")){
// lock is clear, so grab it.
Global.SetBool("myLock",true);
}else {
// lock is held, so return.
return;
}
}// end atomic.
// Release Lock at end of use.
atomic {
Global.SetBool("myLock", false);
}
-Gtrout
Please Log in or Create an account to join the conversation.